#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDockWidget>
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QDockWidget *dockWidget = new QDockWidget();

    this->addDockWidget(Qt::LeftDockWidgetArea,dockWidget);

    QWidget* continer = new QWidget();
    QPushButton* button = new QPushButton("这不是一个按钮");
    QLabel *label = new QLabel("cf");
    QVBoxLayout *layout = new QVBoxLayout();

    dockWidget->setWidget(continer);
    continer->setLayout(layout);
    layout->addWidget(label);
    layout->addWidget(button);

    dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
}

MainWindow::~MainWindow()
{
    delete ui;
}

